package red.uec.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import red.uec.model.*;
import red.uec.service.UserAssetService;

@RestController
@RequestMapping("/userAsset")
@Slf4j
public class UserAssetController {

    @Autowired
    private UserAssetService userAssetService;

    @PostMapping
    public UserAssetRegisterResponse register(UserAssetRegisterRequest userAssetRegisterRequest){
        return userAssetService.register(userAssetRegisterRequest);
    }

    @GetMapping
    public UserAssetQueryResponse query(UserAssetQueryRequest userAssetQueryRequest){
        return userAssetService.query(userAssetQueryRequest);
    }

    @PostMapping("/transfer")
    public UserAssetTransferResponse transfer(UserAssetTransferRequest userAssetTransferRequest){
        return userAssetService.transfer(userAssetTransferRequest);
    }
}